Ext.define('extjs6test.model.core.Department', {
    extend: 'Ext.data.Model',
    idProperty: 'departId',
    fields: [
        {name: "departId", type: "int"},
        {name: "departCode", type: "string"},
        {name: "departName", type: "string"},
        {name: "departLevel", type: "int"},
        {name: "parentId", type: "int",reference:'extjs6test.model.core.Department'},
        {name: 'parent.departCode', mapping: 'parent.departCode'},
        {name: 'parent.departName', mapping: 'parent.departName'},
        {name: 'parent.departLevel',mapping:'parent.departLevel'},
        {name: 'parent.departId', mapping: 'parent.departId'},
        {name: "parent.leaf", mapping: 'parent.leaf'},
        {name: "parent.parentId", type: "int",mapping:'parent.parentId'},
        {name: 'leaf', type: 'bool'}
    ]
});